package com.mercenary.wein.screenControl.bean;

import com.google.gson.Gson;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by tuxiao on 2017/3/24.
 */
public class ExeModeBean {
    private int mode;
    private String jobName;
    private String exeTime;
    private int interval;
    private int timeUnit;//0-分钟 1-小时 2-天

    private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd HH:mm:SS");

    public ExeModeBean() {
    }

    public int getMode() {
        return mode;
    }

    public void setMode(int mode) {
        this.mode = mode;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public String getExeTime() {
        return exeTime;
    }

    public Date getExeDate() throws ParseException {
        return simpleDateFormat.parse(exeTime);
    }

    public void setExeTime(String exeTime) {
        this.exeTime = exeTime;
    }

    public int getInterval() {
        return interval;
    }

    public void setInterval(int interval) {
        this.interval = interval;
    }

    public int getTimeUnit() {
        return timeUnit;
    }

    public void setTimeUnit(int timeUnit) {
        this.timeUnit = timeUnit;
    }

    public String toJson(){
        return new Gson().toJson(this);
    }
}
